/*
 * @Author: your name
 * @Date: 2021-06-07 14:20:23
 * @LastEditTime: 2021-06-07 17:04:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \headlines\src\store\index.js
 */
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        num: 1
    },
    mutations: {
        jia(state, nu) {
            state.num += nu
        },
        jian(state, nu) {
            if (state.num != 1) {
                state.num -= nu
            }
        }
    }
})